// Copyright 2012 Lukas Kemmer
//
// Licensed under the Apache License, Version 2.0 (the "License"); you
// may not use this file except in compliance with the License. You
// may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the License.

#ifndef FAINT_LINE
#define FAINT_LINE
#include "point.hh"

class Line{
public:
  // ax + by = c
  Line( faint::coord a, faint::coord b, faint::coord c);
  faint::coord a;
  faint::coord b;
  faint::coord c;
};

class LineSegment{
public:
  LineSegment();
  LineSegment( const Point&, const Point& );
  Point P0() const;
  Point P1() const;
private:
  Point m_p0;
  Point m_p1;
};

faint::coord distance( const Point&, const Line& );
Point intersection( const Line&, const Line& );
Point projection( const Point&, const Line& );

enum class Side{A, B, ON};
Side side( const Point&, const Point&, const Point&);

Line unbounded(const LineSegment&);

#endif
